home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.3 / GetInt.3 < prev    next >
Text File  |  1995-07-25  |  6KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333))))                TTTTccccllll (((( ))))                TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           Tcl_GetInt, Tcl_GetDouble,  Tcl_GetBoolean  -  convert  from
  12.           string to integer, double, or boolean
  13.  
  14.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.           ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  16.  
  17.           int
  18.           TTTTccccllll____GGGGeeeettttIIIInnnntttt(_i_n_t_e_r_p, _s_t_r_i_n_g, _i_n_t_P_t_r)
  19.  
  20.           int
  21.           TTTTccccllll____GGGGeeeettttDDDDoooouuuubbbblllleeee(_i_n_t_e_r_p, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r)
  22.  
  23.           int
  24.           TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn(_i_n_t_e_r_p, _s_t_r_i_n_g, _b_o_o_l_P_t_r)
  25.  
  26.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  27.           Tcl_Interp   *_i_n_t_e_r_p      (in)      Interpreter to  use  for
  28.                                               error reporting.
  29.  
  30.           char         *_s_t_r_i_n_g      (in)      Textual  value   to   be
  31.                                               converted.
  32.  
  33.           int          *_i_n_t_P_t_r      (out)     Points to place to store
  34.                                               integer  value converted
  35.                                               from _s_t_r_i_n_g.
  36.  
  37.           double       *_d_o_u_b_l_e_P_t_r   (out)     Points to place to store
  38.                                               double-precision
  39.                                               floating-point     value
  40.                                               converted from _s_t_r_i_n_g.
  41.  
  42.           int          *_b_o_o_l_P_t_r     (out)     Points to place to store
  43.                                               boolean  value  (0 or 1)
  44.                                               converted from _s_t_r_i_n_g.
  45.      _________________________________________________________________
  46.  
  47.  
  48.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  49.           These  procedures  convert  from  strings  to  integers   or
  50.           double-precision    floating-point    values   or   booleans
  51.           (represented as 0-  or  1-valued  integers).   Each  of  the
  52.           procedures  takes  a  _s_t_r_i_n_g  argument,  converts  it  to an
  53.           internal form of a particular type, and stores the converted
  54.           value  at  the  location  indicated by the procedure's third
  55.           argument.  If all goes well, each of the procedures  returns
  56.           TCL_OK.   If  _s_t_r_i_n_g  doesn't have the proper syntax for the
  57.           desired type then TCL_ERROR is returned, an error message is
  58.           left  in _i_n_t_e_r_p->_r_e_s_u_l_t, and nothing is stored at *_i_n_t_P_t_r or
  59.           *_d_o_u_b_l_e_P_t_r or *_b_o_o_l_P_t_r.
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/10/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333))))                TTTTccccllll (((( ))))                TTTTccccllll____GGGGeeeettttIIIInnnntttt((((3333))))
  71.  
  72.  
  73.  
  74.           TTTTccccllll____GGGGeeeettttIIIInnnntttt expects _s_t_r_i_n_g to  consist  of  a  collection  of
  75.           integer digits, optionally signed and optionally preceded by
  76.           white space.  If the first  two  characters  of  _s_t_r_i_n_g  are
  77.           ``0x''  then  _s_t_r_i_n_g  is expected to be in hexadecimal form;
  78.           otherwise, if the first character of _s_t_r_i_n_g  is  ``0''  then
  79.           _s_t_r_i_n_g  is  expected to be in octal form;  otherwise, _s_t_r_i_n_g
  80.           is expected to be in decimal form.
  81.  
  82.           TTTTccccllll____GGGGeeeettttDDDDoooouuuubbbblllleeee expects _s_t_r_i_n_g to consist of a  floating-point
  83.           number,  which  is:   white  space;   a  sign; a sequence of
  84.           digits;  a decimal point;  a sequence of digits;  the letter
  85.           ``e'';   and  a  signed decimal exponent.  Any of the fields
  86.           may be omitted, except that  the  digits  either  before  or
  87.           after  the decimal point must be present and if the ``e'' is
  88.           present then it must be followed by the exponent number.
  89.  
  90.           TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn expects _s_t_r_i_n_g to specify  a  boolean  value.
  91.           If   _s_t_r_i_n_g   is   any   of  0000,  ffffaaaallllsssseeee,  nnnnoooo,  or  ooooffffffff,  then
  92.           TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn stores a zero value at *_b_o_o_l_P_t_r.   If  _s_t_r_i_n_g
  93.           is any of 1111, ttttrrrruuuueeee, yyyyeeeessss, or oooonnnn, then 1 is stored at *_b_o_o_l_P_t_r.
  94.           Any of these  values  may  be  abbreviated,  and  upper-case
  95.           spellings are also acceptable.
  96.  
  97.  
  98.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  99.           boolean, conversion, double, floating-point, integer
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/10/95)
  130.  
  131.  
  132.  
  133.